<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/head.jsp"%>
<%@ page import="java.util.List" %>
<%@ page import="cn.hs.blog.article.module.Article" %>
<%@ page import="cn.hs.blog.base.PageLoader" %>
<%
	PageLoader<Article> pageLoader = (PageLoader<Article>)request.getAttribute("page");
	List<Article> articles = null;
	if(pageLoader != null){
		articles = pageLoader.getResultList();
	}
	if(articles == null || articles.size() < 1){
%>
			<div class="post">
			<h3><a name="4263590928135408474">暂无内容，敬请期待</a></h3>
			</div>

<%
	}else{
	    for(int i = 0; i < pageLoader.getNumPerPage() && i < articles.size(); i++){
	    	Article article = articles.get(i);
%>
			<div class="post">

			<h3><a name="4263590928135408474"><%= article.getTitle() %></a></h3>

			<p class="byline-timestamp"><span id='time<%= article.getId() %>'><%= article.getDate() %></span></p>
			
			<div style="clear: both;"></div>
			<span class="byline-author">发表者：<%= article.getAuthor() %> </span> <br />
			<br />
				<%= article.getContent() %>
			</div>
<%
	    }
	}
%>
			<br />
			<div>
				<%
					int pageNum = pageLoader.getPageNum();
					
					if(pageNum > 1){
				%>
					<a href="/blog/article/Article.do?method=listForPage&pageNum=<%= pageNum - 1 %>">上一页</a>
				<%     
					}else{
				%>
					上一页
				<%
					}
				%>
				第 <%= pageLoader.getPageNum() %> 页，每页<%= pageLoader.getNumPerPage() %>条记录。
				
				<%
					if(pageLoader.getIsEnd()){
				%>
				下一页
				<% 
					}else{
				%>
				<a href="/blog/article/Article.do?method=listForPage&pageNum=<%= pageNum + 1 %>">下一页</a>
				<%
					}
				%>
			</div>		

<br />
<br />
<%@ include file="/jsp/common/feet.jsp"%>
